package com.hfjyz.registration.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.validation.Errors;
import org.springframework.web.servlet.mvc.SimpleFormController;

import com.hfjyz.registration.contants.ExamContants;

public class AnnouncementDetailController extends SimpleFormController {

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.springframework.web.servlet.mvc.AbstractWizardFormController#
	 * referenceData(javax.servlet.http.HttpServletRequest, java.lang.Object,
	 * org.springframework.validation.Errors, int)
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	@Override
	protected Map referenceData(HttpServletRequest request, Object command,
			Errors errors) throws Exception {
		Map m = new HashMap();
		m.put("exam",
				request.getSession().getAttribute(
						ExamContants.SESSION_KEY_EXAM_INFO));
		return m;
	}

//	@Override
//	protected ModelAndView onSubmit(HttpServletRequest request,
//			HttpServletResponse response, Object command, BindException errors)
//			throws Exception {
//		request.getSession()
//				.removeAttribute(ExamContants.SESSION_KEY_EXAM_INFO);
//		return new ModelAndView(new RedirectView("announcementDetail.action"));
//	}
}